package test.test04;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Main test = new Main();
        test.myans3();
    }

    public void myans1(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] wight = new int[n];

        for(int i = 0;i<n;i++){
            wight[i] = sc.nextInt();
        }

        int[] wightSum = new int[n+1];
        for(int i = 1;i<=n;i++){
            wightSum[i] = wightSum[i-1]+wight[i-1];
        }

        int[] output = new int[n];
        for (int i = 0;i<n;i++){
            output[i] = sc.nextInt();
        }

        for(int i = 0;i<n;i++){
            int val = wightSum[output[i]];
            for(int j = output[i];j<n+1;j++){
                if(wightSum[j] == 0){
                    break;
                }
                wightSum[j] -= val;
            }
            System.out.println(getMax(wightSum));
        }
    }
    public int getMax(int[] nums){
        int[] temp = Arrays.copyOf(nums,nums.length);
        Arrays.sort(temp);
        return temp[temp.length-1];
    }


    public void myans2(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int[] prices = new int[n];
        int m = sc.nextInt();
        PriorityQueue<Integer> pq = new PriorityQueue<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        for(int i = 0;i<n;i++){
            int v = sc.nextInt();
            int w = sc.nextInt();
            prices[i] = v + 2*w;
            pq.offer(prices[i]);
        }
        int len = pq.size()-m;
        while (len != pq.size()){
            int val = pq.poll();
            for(int i = 0;i<n;i++){
                if(prices[i] == val){
                    prices[i] = 0;
                    System.out.printf("%d ",i+1);
                    break;
                }
            }
        }
    }
    public void myans3(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] user = new String[n+1];
        for(int i = 0;i<=n;i++){
            user[i] = sc.nextLine();
        }

        for (int k = 1;k<=n;k++){
            String str = user[k];
            char[] strs = str.toCharArray();
            if(!(strs[0]>='a'&& strs[0]<='z') && !(strs[0]>='A'&&strs[0]<='Z')){
                System.out.println("Wrong");
                continue;
            }
            int nums = 0;
            int sigh = 0;
            int dig = 0;

            for(int i = 1;i<strs.length;i++){
                if(!(strs[i]>='a'&& strs[i]<='z') || !(strs[i]>='A'&&strs[i]<='Z') || !(strs[i]>='0' && strs[i]<='9')){
                    dig++;
                    break;
                }
                if((strs[i]>='a'&& strs[i]<='z') || (strs[i]>='A'&&strs[i]<='Z')){
                    sigh++;
                }
                if(strs[i]>='0' && strs[i]<='9'){
                    nums++;
                }
            }
            if(nums == 0 || sigh == 0 || dig != 0){
                System.out.println("Wrong");
            }else {
                System.out.println("Accept");
            }

        }

    }


}
